package org.deltaset.meta.internal.testvisit;

import java.io.Serializable;

import org.deltaset.meta.annotation.DsCustom;
import org.deltaset.meta.internal.mockmeta.persistence.Column;
import org.deltaset.meta.internal.mockmeta.persistence.Entity;
import org.deltaset.meta.internal.mockmeta.persistence.Id;
import org.deltaset.meta.internal.mockmeta.persistence.Version;

/**
 *
 * @author dmakariev
 */
@Entity
public class UploadedFile implements Serializable{
    
    @Id   
    private Long id;
    @Version
    @Column(name = "version", nullable = false, updatable = false, unique = false)
    private Long version;
    
    @DsCustom("richtext")
    private String note;
    
    private EmbeddedFile embeddedFile;
    
    public String title(){
        return this.getEmbeddedFile().getName();
    }

    public EmbeddedFile getEmbeddedFile() {
        if(null==embeddedFile){
            embeddedFile = new EmbeddedFile();
        }
        return embeddedFile;
    }

    public void setEmbeddedFile(EmbeddedFile embeddedFile) {
        this.embeddedFile = embeddedFile;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

  

    
}
